﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NetDon.OA.Portal.Components
{
    public partial class UserMultiSearch : UserControlBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public Unit Width
        {
            set { this.txtUserName.Width = value; }
        }
        public string[] SelectedUserId
        {
            get
            {
                if (string.IsNullOrEmpty(this.txtUserId.Value))
                    return null;
                return this.txtUserId.Value.Trim().Split(new char[] { '|' });
            }
            set
            {
                if (value !=null)
                {
                  for(int i=0;i<value.Length;i++)
                    {
                        if (i == 0)
                        {
                            this.txtUserId.Value += value[i];
                            continue;
                        }
                            this.txtUserId.Value += "|" + value[i];
                       
                    }
                }
            }
        }
        public string[] SelectedUserName
        {
            get
            {
                if (string.IsNullOrEmpty(this.txtUserName.Text))
                    return null;
                return this.txtUserName.Text.Trim().Split(new char[] { '|' });
            }
            set
            {
                if (value != null)
                {
                    for (int i = 0; i < value.Length; i++)
                    {
                        if (i == 0)
                        {
                            this.txtUserName.Text += value[i];
                            continue;
                        }
                        this.txtUserName.Text += "|" + value[i];

                    }
                }
            }
        }
        public bool IsRequiredField
        {
            set { this.RequiredMark1.Visible = this.RequiredFieldValidator2.Visible = value;
                this.RequiredFieldValidator2.Enabled = value;
            }
          get { return this.RequiredFieldValidator2.Enabled; }
        }
     
    }
}